using System;
using System.Collections;
using System.Data;
using System.Data.OleDb;
public class RefundaUtil
{
	private OleDbCommand oleDbCommand_0;
	private OleDbCommand oleDbCommand_1;
	private OleDbCommand oleDbCommand_2;
	private OleDbCommand oleDbCommand_3;
	public OleDbConnection oleDbConnection_0;
	public string string_0 = "";
	public void method_0()
	{
		if (this.oleDbConnection_0 == null)
		{
			string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0 ;Data Source=" + this.string_0;
			this.oleDbConnection_0 = new OleDbConnection(connectionString);
			this.oleDbConnection_0.Open();
		}
	}
	public void method_1()
	{
		try
		{
			this.oleDbConnection_0.Close();
			this.oleDbConnection_0.Dispose();
		}
		catch (Exception)
		{
		}
	}
	public ArrayList method_2(string string_1, out string string_2)
	{
		OleDbDataReader oleDbDataReader = null;
		ArrayList result;
		try
		{
			ArrayList arrayList = new ArrayList();
			this.oleDbCommand_0 = this.method_6(this.oleDbCommand_0, string_1);
			oleDbDataReader = this.oleDbCommand_0.ExecuteReader();
			while (oleDbDataReader.Read())
			{
				arrayList.Add(new GClass32
				{
					int_0 = int.Parse(oleDbDataReader["ID"].ToString()),
					string_0 = oleDbDataReader["qq"].ToString(),
					float_0 = float.Parse(oleDbDataReader["refundamount"].ToString()),
					string_1 = oleDbDataReader["refunddatetime"].ToString(),
					string_2 = oleDbDataReader["remark"].ToString(),
					int_1 = int.Parse(oleDbDataReader["updflg"].ToString())
				});
			}
			string_2 = "";
			result = arrayList;
		}
		catch (Exception ex)
		{
			string_2 = ex.ToString();
			result = null;
		}
		finally
		{
			this.method_7(oleDbDataReader);
		}
		return result;
	}
	public bool method_3(GClass32 gclass32_0, out string string_1)
	{
		bool result;
		try
		{
			string text = "INSERT INTO refund(qq, refundamount, refunddatetime, remark, updflg) VALUES ('{qq}', {refundamount}, '{refunddatetime}', '{remark}', {updflg});";
			text = text.Replace("{qq}", gclass32_0.string_0).Replace("{refundamount}", string.Concat(gclass32_0.float_0)).Replace("{refunddatetime}", gclass32_0.string_1).Replace("{remark}", gclass32_0.string_2.Replace("'", "").Replace("\n", "").Replace("\t", "")).Replace("{updflg}", string.Concat(gclass32_0.int_1));
			this.oleDbCommand_1 = this.method_6(this.oleDbCommand_1, text);
			this.oleDbCommand_1.ExecuteNonQuery();
			string_1 = "";
			result = true;
		}
		catch (Exception ex)
		{
			string_1 = ex.ToString();
			result = false;
		}
		return result;
	}
	public bool method_4(string string_1, out string string_2)
	{
		bool result;
		try
		{
			this.oleDbCommand_2 = this.method_6(this.oleDbCommand_2, string_1);
			this.oleDbCommand_2.ExecuteNonQuery();
			string_2 = "";
			result = true;
		}
		catch (Exception ex)
		{
			string_2 = ex.ToString();
			result = false;
		}
		return result;
	}
	public bool method_5(string string_1, out string string_2)
	{
		bool result;
		try
		{
			this.oleDbCommand_3 = this.method_6(this.oleDbCommand_3, string_1);
			this.oleDbCommand_3.ExecuteNonQuery();
			string_2 = "";
			result = true;
		}
		catch (Exception ex)
		{
			string_2 = ex.ToString();
			result = false;
		}
		return result;
	}
	public OleDbCommand method_6(OleDbCommand oleDbCommand_4, string string_1)
	{
		if (this.oleDbConnection_0 == null)
		{
			this.method_0();
		}
		if (oleDbCommand_4 == null || oleDbCommand_4.Connection == null || oleDbCommand_4.Connection.State != ConnectionState.Open)
		{
			oleDbCommand_4 = new OleDbCommand(string_1, this.oleDbConnection_0);
			return oleDbCommand_4;
		}
		oleDbCommand_4.CommandText = string_1;
		return oleDbCommand_4;
	}
	public void method_7(OleDbDataReader oleDbDataReader_0)
	{
		try
		{
			oleDbDataReader_0.Close();
			oleDbDataReader_0.Dispose();
		}
		catch
		{
		}
	}
}
